package com.admin.security.exception;

import java.io.IOException;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;

import com.admin.utils.base.DataResult;
import com.admin.utils.base.ResponseFormatter;





/**
 * Token校验异常
 * Date: 2019年10月26日 上午3:53:14 <br/>
 * 
 * @author monxz
 * @version
 * 
 */
public class AuthEntryPoint implements AuthenticationEntryPoint {

	@Override
	public void commence(HttpServletRequest httpServletRequest, HttpServletResponse response, AuthenticationException e)
			throws IOException, ServletException {
		ResponseFormatter.initResponse(response, DataResult.buildFail("Token错误或者是时效!"));
	}
}
